package org.luxor.accesslog.config;

import org.luxor.accesslog.aspect.AccessLogAspect;
import org.luxor.commons.elasticsearch.config.ElasticClientAutoConfig;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * OSS文件存储配置
 * @author Mr.yan @date 2020/3/11
 */
@Configuration
@AutoConfigureAfter(ElasticClientAutoConfig.class)
@ComponentScan("org.luxor.accesslog")
@EnableConfigurationProperties({AccessLogProperties.class})
public class AccessLogAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public AccessLogAspect accessLogAspect() {
        return new AccessLogAspect();
    }
}
